<?php
include ('../../__global.php');

class aj_get_suggest_tag extends ml_controller{
    private $key;
    
    function initParam(){
        
        $this->key = $this->input('key', '', '');
        
    }
    
    function checkParam(){
        
        
        if (empty($this->key)) {
            $this->api_output(ML_RCODE_PARAM);
        }
        //$this->searchKey = Tool_antiXss::clean_danger_param(trim($this->searchKey));
        
    }
    
    function main(){
        $a = new ml_biz_suggest_tag();
        $this->key = strtolower($this->key);
        $re = $a->get_suggest_tag($this->key);
        
        foreach($re as $b){
            $v[] = $b['tag'];
        }
        //var_dump($v);
        
        $data = $v;
        if(empty($v)){$data = array();}
        $this->api_output(ML_RCODE_SUCC, $data);
    }
}

new aj_get_suggest_tag();